//
//  THBaseTableViewCell.h
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 BaseBusiness. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "KTableData.h"

@class THBaseEntity;
@class THBaseTableViewCell;

typedef NS_ENUM(NSInteger,TableClickEvent)
{
    TableClickEventValue1 = 0,
    TableClickEventValue2,
    TableClickEventValue3,
    TableClickEventValue4,
    TableClickEventValue5,
    TableClickEventValue6,
    TableClickEventValue7,
    TableClickEventValue8,
    TableClickEventValue9,
    TableClickEventValue10,
};

@protocol THBaseTableViewCellDelegate <NSObject>


@optional

/**配置cell点击事件*/
- (void)clickTableView:(THBaseTableViewCell*)tableCell
        withEventType:(TableClickEvent)eventValue;

/**配置cell点击事件*/
- (void)clickTableView:(THBaseTableViewCell*)tableCell
        withtouchView:(UIView *)touchView
            EventType:(TableClickEvent)eventValue;

/**配置cell点击事件*/
- (void)clickTableView:(THBaseTableViewCell*)tableCell
        withtouchView:(UIView *)touchView
            EventType:(TableClickEvent)eventValue
                value:(id)value;
@end

@interface THBaseTableViewCell : UITableViewCell

/**通用delegate,子类可以通过继承以扩宽其方法*/
@property(nonatomic,weak) id<THBaseTableViewCellDelegate>delegate;

/**实例化方法(可读取xib)*/
+ (id)getInstance;

/// 添加子控件
- (void)setupUI;
/// 配置子控件
- (void)configViews;
/// 布局子控件
- (void)setupFrames;
/**返回唯一标识*/
+ (NSString *)cellIdentifier;
/**快速配置视图*/
- (void)configureCellWithEntity:(THBaseEntity*)entity;
/**快速配置视图*/
- (void)configTableCellIndexPath:(NSIndexPath*)indexPath;

@end
